package base.day06;

import java.util.Random;
import java.util.concurrent.ForkJoinPool;

public class Study9 {
    public static void main(String[] args) {
        //大乱二维数组中的元素
        int[][] array = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
        Random rd = new Random();
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[0].length; j++) {
                int x = rd.nextInt(array.length);
                int y = rd.nextInt(array[j].length);
                int temp = array[i][j];
                array[i][j] = array[x][y];
                array[x][y] = temp;
            }
        }
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[0].length; j++) {
                System.out.print(array[i][j] + " ");
            }
            System.out.println();
        }
    }
}
